import type {
  KnowledgeParams,
  KnowledgePage,
  DoctorPage,
  PageParams,
  FollowType,
} from '@/types/consult'
import { request } from '@/utils/request'

// 1. 获取文章分页列表
export const getKnowledgePage = (params: KnowledgeParams) =>
  request<KnowledgePage>('/patient/home/knowledge', 'GET', params)

// 2. 获取医生分页列表
export const getDoctorPage = (params: PageParams) =>
  request<DoctorPage>('/home/page/doc', 'GET', params)

// 3. 关注与取消关注
export const followDoctor = (id: string, type: FollowType = 'doc') =>
  request<{ id: string }>('/like', 'POST', { id, type })
